#include "GnSystemDefine.h"
#include "GnTOther.h"
#include "GnTypeList.h"
#include "GnTypeTraits.h"


namespace GnT
{
	template <int T>
	struct _TypeTraits_Aux
	{
		typedef _TrueType hasTrivialCopyConstructor;
	};

	template<>
	struct _TypeTraits_Aux<-1>
	{
		typedef _FalseType hasTrivialCopyConstructor;
	};

	typedef GNTYPELIST_22( gint, guint, glong, gulong, gshort, gushort, gchar, guchar, gint8,
		guint8, gint16, guint16, gint32, guint32, gint64, guint64, gtint, gtuint, gtlong, gtulong,
		gwchar, gtchar ) GnStdVariable;

	template< typename T >
	class GnStreamTraits
	{
		typedef typename UnConst< T >::Result NonConstType;
		typedef typename UnVolatile< typename UnConst<T>::Result >::Result UnqualifiedType;

		enum { isStdVariable = IndexOf<GnStdVariable, UnqualifiedType>::value >= 0 ||
			IndexOf<GnStdVariable, typename ReferenceTraits<UnqualifiedType>::ReferredType>::value >= 0 };

		typedef	typename _TypeTraits_Aux<isStdVariable>::hasTrivialCopyConstructor isTrivialCopy;
	};
}